// 自动生成模板HealthQAndA
package health

import (
	"gitee.com/g-qs/gin-vue-admin/server/global"
	"gitee.com/g-qs/gin-vue-admin/server/model/system"
	"gitee.com/g-qs/gin-vue-admin/server/model/user"
)

// HealthQAndA 健康问答表 结构体
type HealthQAndA struct {
	global.GVA_MODEL
	Question string         `json:"question" form:"question" gorm:"column:question;comment:问题;type:text;"` //问题
	Answer   string         `json:"answer" form:"answer" gorm:"column:answer;comment:回答;type:text;"`       //回答
	Dose     string         `json:"dose" form:"dose" gorm:"column:dose;comment:回答;size:255;"`              //回答
	Author   uint           `json:"author" form:"author" gorm:"column:author;comment:上传人;size:10;"`        //上传人
	User     system.SysUser `json:"user" gorm:"->;foreignKey:Author;references:ID;"`
}

// HealthQuestion 健康问题结构体
type HealthQuestion struct {
	global.GVA_MODEL
	Uid      uint      `json:"uid" form:"uid" gorm:"column:uid;comment:提问者;size:10;"`                 //提问者
	Question string    `json:"question" form:"question" gorm:"column:question;comment:问题;type:text;"` //问题
	User     user.User `json:"user" gorm:"foreignKey:Uid;references:ID;"`
}

// TableName 健康问答表 HealthQAndA自定义表名 fd_health_q_and_a
func (HealthQAndA) TableName() string {
	return "fd_health_q_and_a"
}

// TableName 健康问答-待回答问题表 HealthQuestion自定义表名 fd_health_question
func (HealthQuestion) TableName() string {
	return "fd_health_question"
}
